<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>PassJava文档</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="description" content="Description">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-dark-mode@0.6.1/dist/style.css" />
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/sidebar.min.css" />
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/sidebar-folder.min.css" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
  <script>
	var _hmt = _hmt || [];
	(function() { 
    // MARK: ===========================百度统计，请移除此处代码==============================
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?c70166876c49625d2a39ad01a26ff538";
    var s = document.getElementsByTagName("script")[0]; 
    s.parentNode.insertBefore(hm, s);
    // ================================== END ==============================================
	})();
  </script>
  
</head>
<body>
  <div id="app"></div>
  <div id="gitalk-container"></div>
  <script>
    window.$docsify = {
      name: 'PassJava 教程连载中',
      repo: 'https://github.com/jackson0714/PassJava-Learning',
      loadNavbar: true,
      loadSidebar: true, // 加载自定义侧边栏
      maxLevel: 2, // 默认情况下会抓取文档中所有标题渲染成目录，可配置最大支持渲染的标题层级。
      subMaxLevel: 4, // 生成目录的最大层级
      mergeNavbar: true, // 小屏设备下合并导航栏到侧边栏
      coverpage: true,
      auto2top: true,
      search: {
        placeholder: '搜索',
        noData: '找不到结果!',
        depth: 3
      },
      alias: { // 定义路由别名，可以更自由的定义路由规则。 支持正则
        '/.*/_sidebar.md': '/_sidebar.md',//防止意外回退
        '/.*/_navbar.md': '/_navbar.md'
      },
      pagination: {
        previousText: '上一篇',
        nextText: '下一篇',
        crossChapter: true,
        crossChapterText: true
      },
      darkMode: {
        light: {
          toggleBtnBg: '#42b983'
        }
      },
      plugins: [
        function (hook) {
          var header = [
            '<p>',
              // '<a href="https://www.aliyun.com/sale-season/2020/procurement-new-members?userCode=thp9caen">',
              '<img src="https://img-blog.csdnimg.cn/20210719222911357.png" alt="公众号" width="430px" height="136px" style="margin-top:-70px">',
              '<img src="https://img-blog.csdnimg.cn/2021071922263371.png" alt="公众号" width="327px" height="145px" style="margin-top:-70px">',
              '<br/>',
              '<span><a href="http://www.passjava.cn/" target="_blank">从零学架构认准： www.passjava.cn</a></span>',
              '</p>'
          ].join('');
          var footer = [
            '<hr/>',
            '<footer style="text-align: center">',
              '<p>',
              // '<a href="https://www.aliyun.com/sale-season/2020/procurement-new-members?userCode=thp9caen">',
              //'<img src="http://cdn.jayh.club/blog/20200910/8cQn6wSJtQND.png?imageslim" alt="公众号" width="557px" height="294px">',
              '<img src="https://img-blog.csdnimg.cn/20210522084205664.png" alt="公众号" width="557px" height="294px">',
              '<img src="https://oscimg.oschina.net/oscnet/up-a2f2ba3e2ec0d84f7b895c5476d98f202dc.png" alt="微信" width="557px" height="294px">',
            '</p>',
            '<span><a href="https://beian.miit.gov.cn/" target="_blank">鄂ICP备19010052号-2</a></span>',
            '</footer>'
          ].join('');
          hook.afterEach(function (html) {
            var isReadme = window.location.href.indexOf("README");
            if (isReadme === -1) {
              return header + html + footer;
            } else {
              return html + footer;
            }
          });
        }
      ]
    }
  </script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-c.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-cpp.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-json.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-java.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-python.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify-dark-mode@0.6.1/dist/index.js"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
	<script src="//cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/gitalk.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
  <script>
    // 生成 gitalk 插件
    title = location.hash.match(/#(.*?)([?]|$)/)
    if (title != null) {
      title = location.hash.match(/#(.*?)([?]|$)/)[1]
    }
    
    // 限制 50 个字符
    if (title != null) {
      title = decodeURI(title.substring(1, title.length))
      if (title.length >= 50) {
        title = title.substring(title.length - 50, title.length)
      }
    } else {
      title = 'home page'
    }

    const gitalk = new Gitalk({
      clientID: '7de8e380bec2231f0544',
      clientSecret: '04347ec3cc38b5cef2c15938a3142c1836ed54fd',
      repo: 'PassJava-Learning',
      owner: 'Jackson0714',
      admin: ['Jackson0714'],
      // facebook-like distraction free mode
      distractionFreeMode: true,
      title: title,
      id: title,
      //id: location.pathname
    })
    // 监听URL中hash的变化，如果发现换了一个MD文件，那么刷新页面，解决整个网站使用一个gitalk评论issues的问题。
    window.onhashchange = function(event){
      if(event.newURL.split('?')[0] !== event.oldURL .split('?')[0]) {
        location.reload()
      }
    }
  </script>
</body>
</html>
